import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysUserRoleRelation = (params) => {
  params.head.transCode = 'querySysUserRoleRelation';
  return request({
    url: '/platform/sysUserRoleRelation/querySysUserRoleRelation',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysUserRoleRelationListPage = (params) => {
  params.head.transCode = 'querySysUserRoleRelationListPage';
  return request({
    url: '/platform/sysUserRoleRelation/querySysUserRoleRelationListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysUserRoleRelation = (params) => {
  params.head.transCode = 'saveSysUserRoleRelation';
  return request({
    url: '/platform/sysUserRoleRelation/saveSysUserRoleRelation',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysUserRoleRelationList = (params) => {
  params.head.transCode = 'saveSysUserRoleRelationList';
  return request({
    url: '/platform/sysUserRoleRelation/saveSysUserRoleRelationList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysUserRoleRelation = (params) => {
  params.head.transCode = 'saveOrUpdateSysUserRoleRelation';
  return request({
    url: '/platform/sysUserRoleRelation/saveOrUpdateSysUserRoleRelation',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysUserRoleRelationList = (params) => {
  params.head.transCode = 'saveOrUpdateSysUserRoleRelationList';
  return request({
    url: '/platform/sysUserRoleRelation/saveOrUpdateSysUserRoleRelationList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysUserRoleRelation = (params) => {
  params.head.transCode = 'updateSysUserRoleRelation';
  return request({
    url: '/platform/sysUserRoleRelation/updateSysUserRoleRelation',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysUserRoleRelation = (params) => {
  params.head.transCode = 'deleteSysUserRoleRelation';
  return request({
    url: '/platform/sysUserRoleRelation/deleteSysUserRoleRelation',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysUserRoleRelationList = (params) => {
  params.head.transCode = 'deleteSysUserRoleRelationList';
  return request({
    url: '/platform/sysUserRoleRelation/deleteSysUserRoleRelationList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysUserRoleRelationExcel = (params) => {
  downloadExcel({
    url: '/platform/sysUserRoleRelation/excelDownload/exportSysUserRoleRelationExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
